<include file="public/header" />
<include file="public/left" />
<style type="text/css">
    #l-map{ width:700px; height: 400px; }
</style>
<script type="text/javascript"
        src="http://api.map.baidu.com/api?v=2.0&ak=4IU3oIAMpZhfWZsMu7xzqBBAf6vMHcoa">
</script>
<div id="toolTipLayer" style="position: absolute; z-index: 9999; display: none; visibility: visible; left: 95px; top: 573px;"></div>
<div id="append_parent"></div>
<div id="ajaxwaitid"></div>
<div class="page">
    <div class="fixed-bar">
        <div class="item-title"><a class="back" href="javascript:history.back();" title="返回列表">返回上一页</a>
            <div class="subject">
                <h3>线路司机信息编辑</h3>
                <h5>网站系统权限资源管理</h5>
            </div>
        </div>
    </div>

    <div id="searchResultPanel" style="border:1px solid #C0C0C0;width:150px;height:auto; display:none;"></div>
    <form method="post" enctype="multipart/form-data">
        <section>
            <ul class="ulColumn2">
                <style>
                    .table{width: 300px;margin-left: 120px;text-align: center}
                    .textbox {
                        border: 1px #139667 solid;
                        height: 29px;
                        line-height: 26px;
                        padding: 5px;
                        font-size: 12px;
                        vertical-align: middle;
                    }
                </style>
                <li>
                    <span class="item_name" style="width:120px;">选择司机： </span>
                    <volist name="driver" id="vo">
                        <label><input type="radio" name="driver_id" value="{$vo.driver_id}" <eq name="data['driver_id']" value="$vo.driver_id">checked</eq> ><a href="javascript:;">{$vo.driver.nickname}&nbsp;{$vo.driver.mobile}</a></label><br>
                    </volist>

                </li>

                <li>
                    <input type="hidden" name="id" value="{$id?$id:'';}">
                    <span class="item_name" style="width:120px;"></span>
                    <input type="button" class="link_btn1 link_btn" value="提交" />
                </li>
            </ul>
        </section>
    </form>
    <script>

        $(".link_btn1").click(function(){
            var formData = new FormData();
            var id = $('input[name="id"]').val();
//            alert(id);
            var driver_id = $('input[name="driver_id"]:checked').val();
//            alert(driver_id);
            formData.append('id',id);
            formData.append('driver_id',driver_id);

            $.ajax({
                url:"{:url('Set/routedriver')}",
                type:'POST',
                data:formData,
                async:false,
                processData:false,
                contentType:false,
                success:function(result){
//                    console.log(result)
                    if(result.code == 0){
                        layer.alert(result.msg);
                    }else{
                        location.href = "{:url('set/route')}";
                    }
                }
            });
        })
    </script>
</div>
</section>
</body>

</html>